#SPECCPU2006的地址
SPECCPU2006DIR="/home/gjm/app/speccpu2006-v1.0.1"
#打包的存放地址
Packagingaddress="/home/gjm/wendang/riscv"
#config中的exe的值，也就是编译的run文件夹名称
extNAME="jindie_close_NOmut50_NOmit1000"
#数据集
size="ref"
tune="base"











#-------------------------复制部分---------------------------------------
target_dir="${Packagingaddress}/${extNAME}"
mkdir -p "$target_dir"  # -p 会自动创建所有不存在的父目录

#复制run目录
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/400.perlbench/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/400.perlbench
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/401.bzip2/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/401.bzip2
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/403.gcc/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/403.gcc
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/429.mcf/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/429.mcf
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/445.gobmk/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/445.gobmk
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/456.hmmer/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/456.hmmer
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/458.sjeng/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/458.sjeng
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/462.libquantum/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/462.libquantum
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/464.h264ref/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/464.h264ref
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/471.omnetpp/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/471.omnetpp
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/473.astar/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/473.astar
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/483.xalancbmk/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/483.xalancbmk
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/999.specrand/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/999.specrand
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/410.bwaves/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/410.bwaves
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/416.gamess/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/416.gamess
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/433.milc/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/433.milc
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/434.zeusmp/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/434.zeusmp
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/435.gromacs/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/435.gromacs
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/436.cactusADM/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/436.cactusADM
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/437.leslie3d/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/437.leslie3d
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/444.namd/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/444.namd
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/447.dealII/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/447.dealII
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/450.soplex/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/450.soplex
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/453.povray/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/453.povray
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/454.calculix/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/454.calculix
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/459.GemsFDTD/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/459.GemsFDTD
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/465.tonto/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/465.tonto
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/470.lbm/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/470.lbm
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/481.wrf/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/481.wrf
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/482.sphinx3/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/482.sphinx3
cp -r ${SPECCPU2006DIR}/benchspec/CPU2006/998.specrand/run/run_${tune}_${size}_${extNAME}.0000 ${Packagingaddress}/${extNAME}/998.specrand

#-------------------------写入运行命令---------------------------------------
cat > ${Packagingaddress}/${extNAME}/run_riscv.sh <<EOF
extNAME="${extNAME}"
tune="${tune}"
EOF

THIS_dir=$(pwd)
cat ${THIS_dir}/config/run_riscv.sh >>${Packagingaddress}/${extNAME}/run_riscv.sh

#打包成压缩包
cd ${Packagingaddress}
zip -r ${extNAME}.zip ${extNAME}/